home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / dev / gui / gui4cli.lha / Gui4Cli / Dir / dir.lock < prev    next >
Text File  |  1999-04-21  |  2KB  |  64 lines

  1. G4C
  2.  
  3. ; This is a LOCK for your amiga.
  4.  
  5. ; All it does is to put up a full screen borderless window, which will
  6. ; not close untill you give the correct pass code.
  7.  
  8.  
  9. WINBIG    0 0 0 0 ""        ; a window at 0,0, screen wide & high
  10. WinType 000010              ; borderless window, with no gadgets
  11.  
  12. CTEXT 200 220 "Authorised Personel Only" times.font 24 2 0 0001
  13.  
  14. xONLOAD
  15.     lk_var  = ""             ; We clear the code variable
  16.     lk_flag = 0
  17.     GuiOpen #this            ; and open the gui upon loading.
  18.  
  19. xOnOpen
  20.     setgad #this 1 ON
  21.  
  22. ; We declare the following xONKEY events, so that we disable the standard
  23. ; window shortcuts (with which the lock could be bypassed).
  24.  
  25. xONKEY #3       ; Control C  - Close window
  26. xONKEY #2       ; Control B  - Window to back
  27. xONKEY #5       ; Control E  - Edit window
  28. xONKEY #10      ; Control J  - Jump screen
  29. xONKEY #18      ; Control R  - Reload
  30. xONKEY #14      ; Control N  - Next Window
  31. xONKEY #17      ; Control Q  - Quit Window
  32. xONKEY #23      ; Control W  - Window size adjustment
  33. xONKEY #26      ; Control Z  - Zoom Window
  34. xONKEY #19      ; Control S  - Status
  35.  
  36. xONInactive
  37.     guiwindow #this FRONT
  38.     guiscreen #this FRONT
  39.  
  40. Text 200 60 240 14 "Input pass code wanted:" 100 NOBOX
  41.     gadid 2
  42.  
  43. xTextIn    200 75 240 18 "" lk_var "" 100
  44.     gadid 1
  45.     if $lk_flag = 0                     ; First time - get pass code
  46.        lk_flag = 1
  47.        lk_code = $lk_var
  48.        update #this 2 "Input correct pass code:" 
  49.        update #this 1 ""
  50.        setgad #this 1 ON
  51.     else
  52.        if $lk_var = $lk_code            ; quit if correct.
  53.           GUIQUIT #this
  54.        else
  55.           update #this 2 "Wrong Code !!"
  56.           speak 'Wrong Code! Please do not use this computer!'
  57.           lk_var = ""                   ; Clear the variable for an other try.
  58.           update #this 1 ""
  59.           setgad #this 1 ON
  60.        endif
  61.     endif
  62.  
  63.  
  64.